import {
  ui
} from "~/tools/ui"
const AuthStepType = {
  ONE: 1,
  TWO: 2,
  THREE: 3,
};

const cloudPrefix = getApp().globalData.cloudPrefix
Component({
  options: {
    multipleSlots: true,
  },
  properties: {
    currAuthStep: {
      type: Number,
      value: AuthStepType.ONE,
    },
    userInfo: {
      type: Object,
      value: {},
    },
    userInfoEx: {
      type: Object,
      value: {}
    },
    isNeedGetUserInfo: {
      type: Boolean,
      value: false,
    },
  },
  data: {
    defaultAvatarUrl: cloudPrefix + '/static/img/defaultAvatar@2x.png',
    ucBg: '',
    AuthStepType,
    cloudPrefix
  },
  methods: {
    gotoUserEditPage() {
      this.triggerEvent('gotoUserEditPage');
    },
  },
  attached() {
    const fileID = cloudPrefix + '/static/img/user-center-bg.jpeg'
    ui.getCloudFileUrl(fileID, url => {
      this.setData({
        ucBg: url
      })
    })
  }
});